package WuHanTrainStation;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

//第二管理员菜单类
public class secondAdministratorMenu {
    public void chooseOne() throws IOException, ClassNotFoundException {
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        administratorUtility administratorUtility = new administratorUtility();
        Use use = new Use();
        firstAdministratorMenu firstAdministratorMenu = new firstAdministratorMenu();
        int judgment = 0;
        do {
            System.out.println("  11.修改密码");
            System.out.println("  12.修改密保问题");
            System.out.println("  13.设置密保问题");
            System.out.println("  14.返回主菜单");
            System.out.println("  15.退出");
            switch (bufferedReader.readLine()) {
                case "11":
                    administratorUtility.administratorModifyPassword();
                    use.use();
                    judgment = 1;
                    break;
                case "12":
                    administratorUtility.administratorModifyKey();
                    use.use();
                    judgment = 1;
                    break;
                case "13":
                    administratorUtility.administratorKey();
                    use.use();
                    judgment = 1;
                    break;
                case "14":
                    firstAdministratorMenu.administratorUtility();
                case "15":
                    System.exit(0);
                default:
                    System.out.println("功能号不存在！请正确输入功能号！");
                    judgment = 1;
                    break;
            }
        } while (judgment == 1);
    }

    public void chooseTwo() throws IOException, ClassNotFoundException {
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        Functional functional = new Functional();
        Analysis analysis = new Analysis();
        Use use = new Use();
        firstAdministratorMenu firstAdministratorMenu = new firstAdministratorMenu();
        thirdAdministratorMenu thirdAdministratorMenu = new thirdAdministratorMenu();
        int judgment = 0;
        do {
            System.out.println("  21.增加车辆信息");
            System.out.println("  22.删除车辆信息");
            System.out.println("    221.按车次删除");
            System.out.println("    222.按到达时间删除");
            System.out.println("    223.按出发时间删除");
            System.out.println("    224.按车辆类型删除");
            System.out.println("    225.按场删除");
            System.out.println("    226.按车站删除");
            System.out.println("  23.更改车辆信息");
            System.out.println("    231.更改车次");
            System.out.println("    232.更改到达时间");
            System.out.println("    233.更改出发时间");
            System.out.println("    234.更改车辆类型");
            System.out.println("    235.更改场");
            System.out.println("    236.更改车站");
            System.out.println("  24.查询车辆信息");
            System.out.println("    241.查询车次");
            System.out.println("    242.查询到达时间");
            System.out.println("    243.查询出发时间");
            System.out.println("    244.查询车辆种类");
            System.out.println("    245.查询场");
            System.out.println("    246.查询车站");
            System.out.println("  25.分析车辆信息");
            System.out.println("    251.分析车次");
            System.out.println("    252.分析到达时间");
            System.out.println("    253.分析出发时间");
            System.out.println("    254.分析车辆种类");
            System.out.println("    255.分析场");
            System.out.println("    256.分析车站");
            System.out.println("  26.返回主菜单");
            System.out.println("  27.退出");
            switch (bufferedReader.readLine()) {
                case "21":
                    functional.add();
                    use.use();
                    break;
                case "22":
                    thirdAdministratorMenu.chooseTwoTwo();
                    break;
                case "221":
                    functional.deleteTrains();
                    use.use();
                    judgment = 1;
                    break;
                case "222":
                    functional.deleteArrivingTime();
                    use.use();
                    judgment = 1;
                    break;
                case "223":
                    functional.deleteDepartureTime();
                    use.use();
                    judgment = 1;
                    break;
                case "224":
                    functional.deleteType();
                    use.use();
                    judgment = 1;
                    break;
                case "225":
                    functional.deleteField();
                    use.use();
                    judgment = 1;
                    break;
                case "226":
                    functional.deleteStation();
                    use.use();
                    judgment = 1;
                    break;
                case "23":
                    thirdAdministratorMenu.chooseTwoThree();
                    break;
                case "231":
                    functional.changeTrains();
                    use.use();
                    judgment = 1;
                    break;
                case "232":
                    functional.changeArrivingTime();
                    use.use();
                    judgment = 1;
                    break;
                case "233":
                    functional.changeDepartureTime();
                    use.use();
                    judgment = 1;
                    break;
                case "234":
                    functional.changeType();
                    use.use();
                    judgment = 1;
                    break;
                case "235":
                    functional.changeField();
                    use.use();
                    judgment = 1;
                    break;
                case "236":
                    functional.changeStation();
                    use.use();
                    judgment = 1;
                    break;
                case "24":
                    thirdAdministratorMenu.chooseTwoFour();
                    break;
                case "241":
                    functional.queryTrains();
                    use.use();
                    judgment = 1;
                    break;
                case "242":
                    functional.queryArrivingTime();
                    use.use();
                    judgment = 1;
                    break;
                case "243":
                    functional.queryDepartureTime();
                    use.use();
                    judgment = 1;
                    break;
                case "244":
                    functional.queryType();
                    use.use();
                    judgment = 1;
                    break;
                case "245":
                    functional.queryField();
                    use.use();
                    judgment = 1;
                    break;
                case "246":
                    functional.queryStation();
                    use.use();
                    judgment = 1;
                    break;
                case "25":
                    thirdAdministratorMenu.chooseTwoFive();
                    break;
                case "251":
                    analysis.analysisTrains();
                    use.use();
                    judgment = 1;
                    break;
                case "252":
                    analysis.analysisArrivingTime();
                    use.use();
                    judgment = 1;
                    break;
                case "253":
                    analysis.analysisDepartureTime();
                    use.use();
                    judgment = 1;
                    break;
                case "254":
                    analysis.analysisType();
                    use.use();
                    judgment = 1;
                    break;
                case "255":
                    analysis.analysisField();
                    use.use();
                    judgment = 1;
                    break;
                case "256":
                    analysis.analysisStation();
                    use.use();
                    judgment = 1;
                    break;
                case "26":
                    firstAdministratorMenu.administratorUtility();
                case "27":
                    System.exit(0);
                default:
                    System.out.println("功能号不存在！请正确输入功能号！");
                    judgment = 1;
                    break;
            }
        } while (judgment == 1);
    }

}
